package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;


/**
 * 商品实体类
 *
 * @author lyl
 */
public class ProductBean {
    /**
     * 商品编号
     */
    private int productId;
    /**
     * 商品名称
     */
    private String productName;
    /**
     * 商品价格
     */
    private int productPrice;
    /**
     * 生产地址
     */
    private String productLocation;
    /**
     * 生产日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate productDate;
    /**
     * 商品图片
     */
    private String productImg;

    /**
     * 商品状态（默认为上架状态
     */
    private String productStatue = "上架";
    /**
     * 销售的数量
     */
    private int soldNum;

    public ProductBean() {
    }

    public ProductBean(String productName, int productPrice, String productLocation, LocalDate productDate, String productImg) {
        this.productName = productName;
        this.productPrice = productPrice;
        this.productLocation = productLocation;
        this.productDate = productDate;
        this.productImg = productImg;
    }

    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public int getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(int productPrice) {
        this.productPrice = productPrice;
    }

    public String getProductLocation() {
        return productLocation;
    }

    public void setProductLocation(String productLocation) {
        this.productLocation = productLocation;
    }

    public LocalDate getProductDate() {
        return productDate;
    }

    public void setProductDate(LocalDate productDate) {
        this.productDate = productDate;
    }

    public String getProductImg() {
        return productImg;
    }

    public void setProductImg(String productImg) {
        this.productImg = productImg;
    }

    public int getSoldNum() {
        return soldNum;
    }

    public void setSoldNum(int soldNum) {
        this.soldNum = soldNum;
    }

    public String getProductStatue() {
        return productStatue;
    }

    public void setProductStatue(String productStatue) {
        this.productStatue = productStatue;
    }

    @Override
    public String toString() {
        return "ProductBean{" +
                "productId=" + productId +
                ", productName='" + productName + '\'' +
                ", productPrice=" + productPrice +
                ", productLocation='" + productLocation + '\'' +
                ", productDate=" + productDate +
                ", productImg='" + productImg + '\'' +
                ", productStatue='" + productStatue + '\'' +
                ", soldNum=" + soldNum +
                '}' + "\n";
    }
}
